<?php
/**
 * Description:
 *
 * @author      Eden
 * @datetime    2016/12/26 22:02
 * @copyright   Beijing CmsTop Technology Co.,Ltd.
 */

class Home extends WX_Controller
{

    const PAGE_SIZE = 20;

    /**
     * 初始化
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 主程序
     * @return string
     */
    /*
    public function index()
    {
        $this->load->model('wx/Home/Slider_Model', 'slider');
        $res = $this->slider->getSliderLists();
        if (!$res) {
            $slider = [];
        } else {
            $slider = $res;
        }
        $this->load->view('wx/index/index.html', ['slider' => $slider]);
    }

    public function getLists()
    {
        $send['state'] = true;
        do {
            $page = $this->input->get('page');
            $page = empty($page) || intval($page) <= 0 ? 1 : intval($page);

            $this->load->model('wx/Home/List_Model', 'list');
            $res = $this->list->getLists(($page - 1) * self::PAGE_SIZE, self::PAGE_SIZE);
            if (!$res) {
                $send['data'] = [
                    'total' => 0,
                    'data' => []
                ];
            } else {
                $send['data'] = [
                    'total' => $this->list->getTotal(),
                    'data' => $res
                ];
            }

        } while(false);
        $this->output->send($send);
    }
    */
}